<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<SCRIPT>
    onload=()=>{
        let  arr=[1,2,3,4,5,6,7];
        console.log('直接打印数组',arr);
        console.log(Array.isArray(arr)?'这是一个数组':'这不是一个数组');
        for (let i = 0,j=arr.length0; i < j; i++) {
            console.log('for-i遍历',i,arr[i]);
        }
        for (let u in arr) {
            console.log('for-in遍历',u,arr[u]);
        }
        arr.forEach((v,i)=>console.log('for-Each遍历',i,v));

        //数组解构
        let [a,b,c,d]=arr;
        console.log(a);
        console.log(b);
        console.log(c);
        console.log(d);
        let [a1,...param]=arr;
        console.log(a1);
        console.log(param);
    }
</SCRIPT>
</body>
</html>